#if !defined(ximera_plugins_dinput8_mouse_hpp)
#define ximera_plugins_dinput8_mouse_hpp

#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

#include <ximera/input/imouse.hpp>
#include <ximera/input/dinput8/devicetemplate.hpp>

// -----------------------------------------------------------

namespace ximera { namespace input { namespace dinput8
{
    class XIMERA_PLUGIN_API Mouse: public DeviceTemplate<input::IMouse>
    {
    public:
        Mouse(HWND hWnd, SharedPtr<threading::MessageQueue> const& msgqueue, SharedObject<IDirectInput8> const& dinput);

        virtual ~Mouse();
    
        virtual UInt16 rumble(Byte rumbleIndex) const;

        virtual void rumble(Byte rumbleIndex, UInt16 value);

        virtual void update();

        /*! \brief Returns if the mouse button is pressed.
         *
         *  Returns true if the mouse button is pressed, otherwise returns false.
         *  \param mouseCode Is the code of the mouse button that is wanted 
         */
        virtual bool isMousePressed(MouseCode const& mouseCode);

    private:

        DIMOUSESTATE2 _mouseState;

        void calcCoords();
    };
}}}

// -----------------------------------------------------------

#endif
